package com.zyong.design.pattern.responsibility.case2;

/**
 * 校长
 * @program: zyong-design-pattern
 * @ClassName: SchoolMasterApprover
 * @author: zyong
 * @create: 2024-04-09 00:13
 */
public class SchoolMasterApprover extends AbstractApprover {
    public SchoolMasterApprover(String name) {
        super(name);
    }

    @Override
    protected void processRequest(PurchaseRequest purchaseRequest) {
        if (purchaseRequest.getPrice() > 30000) {
            System.out.println("请求编号 id = " + purchaseRequest.getId() + " 被 " + name + " 处理");
        } else {
            approver.processRequest(purchaseRequest);
        }
    }
}
